home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / Misc. Utilities / Installer 3.4 / Examples - Installer 3.4 / Action Atom Samples / Simple Action Atom Sample / ActionAtomSample.r < prev    next >
Encoding:
Text File  |  1992-09-21  |  6.0 KB  |  187 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: Action Atoms
  6.  *
  7.  *    File:        ActionAtomSample.r -    Rez Source
  8.  *
  9.  *    by:         Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/8/92
  11.  *            rrk - 9/8/92 changed inaa to reference format1 instead of format0.
  12.  *                    Added suspendBusyCursors flag to have arrow cursor displayed
  13.  *                    during the dialog.
  14.  *
  15.  *    Copyright © 1991 Apple Computer, Inc.
  16.  *    All rights reserved.
  17.  *
  18.  *------------------------------------------------------------------------------
  19.  *
  20.  * Install application "TheProgram" into the folder "Root":Installed Application.
  21.  * It demonstrates implementation of an action atom.
  22.  *----------------------------------------------------------------------------*/
  23. /*
  24.  
  25. You can build the script with the following lines:
  26.  
  27.         rez  -o "ActionAtomSample" -t 'bbkr' -c 'bbkr' "ActionAtomSample.r"
  28.         setfile -a i "ActionAtomSample"
  29.         scriptcheck -p "ActionAtomSample"
  30.  
  31. ------------------------------------------------------------------------------------------
  32. */
  33.  
  34. #include "Types.r"
  35. #include "InstallerTypes.r"
  36. #include "ActionAtomSelectors.h"
  37.  
  38. /* 'inaa' code resource definition */
  39. #define        aaCodeID                128
  40.  
  41. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  42. #define kScriptCheckSetsDate    0x01
  43.  
  44. /* Definitions for the file spec atoms (specifications for source and destination files) */
  45. #define fsSourceProgram            2000
  46. #define fsTargetProgram            2001
  47.  
  48. /* This is the name of the source disk */
  49. #define ProgramDisk "Program Disk:"
  50.  
  51. /* where we want to install our file. */
  52. #define TargetPath    ":Installed Application:"
  53.  
  54. /* Definition for the package. */
  55. #define pkTheProgram            3000
  56.  
  57. /* Definition for the file atom */
  58. #define faProgram                4000
  59.  
  60. /* Definition for the package comment resource */
  61. #define cmtTheProgram            5000
  62.  
  63. /* Definitions for the action atom resources */
  64. #define aaAlertID                6000
  65.  
  66. /* September 4, 1992 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  67. /* this value to a LongInt seconds value needed by the Installer. */
  68. #define currentReleaseDate        9041992        
  69. #define currentVersion            101     /* Version 1.0.1 goes in the 'icmt' rsrc */
  70.  
  71. #define iconTheProgram            5100
  72.  
  73. /************************** Easy Install Rule resources **********************************/
  74.  
  75. /***************************** Package Resources ************************************************/
  76. resource 'inpk' (pkTheProgram) {
  77.     format0 {
  78.         ShowsOnCustom,                 /* Package appears in the Custom Install display */
  79.         Removable,                    /* Package can be removed */
  80.         dontForceRestart,            /* no need to restart */
  81.         cmtTheProgram,                 /* package's 'icmt' resource id */
  82.         0,                            /* Package size (filled in by ScriptCheck) */
  83.         "TheProgram", {                /* package name for package that shows on custom */
  84.             'infa', faProgram;
  85.             'inaa', aaAlertID;
  86.         }
  87.     }
  88. };
  89.  
  90. /***************************** Comments ************************************************/
  91. resource 'icmt' (cmtTheProgram) {
  92.     currentReleaseDate,
  93.     currentVersion,
  94.     iconTheProgram,
  95.     "This package installs TeachText. "
  96. };
  97.  
  98. resource 'ICON' (iconTheProgram) {
  99.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  100.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  101.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  102.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  103.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  104.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  105.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  106.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  107. };
  108.  
  109.  
  110. /********************************************* File Specs ******************************************/
  111. /* Source File Specs */
  112. resource 'infs' (fsSourceProgram) {
  113.     'APPL',                                /* File Type */
  114.     'ttxt',                                /* Creator */
  115.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  116.     noSearchForFile,                    /* Do not search the source disk for the file */
  117.     TypeCrMustMatch,                    /* file type and creator on source disk must match */
  118.     ProgramDisk"TeachText"                /* Path to the file */
  119. };
  120.  
  121. /* Target File Specs */
  122. resource 'infs' (fsTargetProgram) {
  123.     'APPL',                                /* File Type */
  124.     'ttxt',                                /* Creator */
  125.     0,                                    /* creation date not needed for target file specs */
  126.     noSearchForFile,                    /* Do not search the target disk for the file */
  127.     TypeCrMustMatch,                    /* not needed for target file specs */
  128.     TargetPath"TeachText"                /* destination Path */
  129. };
  130.  
  131. /******************************************** File Atoms ************************************************/
  132. resource 'infa' (faProgram) {
  133.     format0 {
  134.         delRemove,                        /* Delete the file if remove (option-custom) is clicked    */
  135.         delInstall,                     /* Delete the target before copying new one */
  136.         copy,                             /* Copy the file to the destination */
  137.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  138.         noKeepExisting,                 /* Always replace an existing copy */
  139.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  140.         rsrcFork, dataFork,                /* Copy both forks of the file */
  141.         fsTargetProgram,                /* TARGET file spec for this file */
  142.         fsSourceProgram,                 /* SOURCE file spec for this file */
  143.         0,                                /* atom size (filled in by ScriptCheck) */
  144.         ""                                /* Atom Description (Installer will use file name) */
  145.     };
  146. };
  147.  
  148.  
  149. resource 'inaa'    (aaAlertID) {
  150.     format1 {
  151.         suspendBusyCursors,
  152.         actBefore,
  153.         dontActOnRemove,
  154.         actOnInstall,
  155.         'infn',
  156.         aaCodeID,
  157.         ShowAlertSelector,
  158.         "Display message to user."
  159.     }
  160. };
  161.  
  162. /* Note that since the action atom is listed as actBefore, the Installer will not call
  163.    it with a cleanUpCancel message.  For this to happen you need to implement and
  164.    Action atom with the actAfter flag set.
  165.  */
  166.  
  167. resource 'ALRT' (aaCodeID) {
  168.     {0, 0, 150, 360},
  169.         aaCodeID,
  170.     {
  171.         OK, visible, sound1,
  172.         OK, visible, sound1,
  173.         OK, visible, sound1,
  174.         OK, visible, sound1
  175.     }
  176. };
  177.  
  178. resource 'DITL' (aaCodeID) {
  179.     {
  180.         {122, 280, 142, 348}, Button { enabled, "OK" },
  181.         {8, 64, 96, 348}, StaticText { disabled, "This space available." }
  182.     }
  183. };
  184.  
  185. INCLUDE    "ActionAtomSample.rsrc" 'infn' (1001) AS 'infn' (aaCodeID, $$Attributes);
  186.  
  187.